package routers

import (
	"wx-uniapp-go/api/controller/red_packet"
	"wx-uniapp-go/internal/middleware"
)

// InitRedPacketRoute 初始化红包相关路由
func InitRedPacketRoute() {
	// 红包相关路由组
	redPacketGroup := engine.Group("/red-packet").Use(middleware.CheckLogin())
	{
		redPacketGroup.GET("/account", red_packet.GetAccount)      // 获取红包账户信息
		redPacketGroup.GET("/records", red_packet.ListRecords)     // 获取红包流水记录列表
		redPacketGroup.POST("/use", red_packet.UseRedPacket)       // 使用红包
		redPacketGroup.POST("/refund", red_packet.RefundRedPacket) // 退回红包
		redPacketGroup.POST("/send", red_packet.SendRedPacket)     // 发放红包
	}
}
